var timeStart;

function mostrarCargandoDialog() {
		// This starts the indeterminate bar
       dijit.byId('cargandoDatosDialog').show();
       dijit.byId("cargandoDatosProgressBar").update({indeterminate: true});
       // Do a call to see what the average response time is
	   timeStart = new Date();
}

function ocultarCargandoDialog(){
	// Stop the indeterminate bar
	dijit.byId("cargandoDatosProgressBar").update({
		indeterminate: false
	});
	avgTime = new Date() - timeStart;
	//Now you can estimate the time for 10 calls
	avgTime10 = avgTime * 10;
	dijit.byId("cargandoDatosProgressBar").update({
		maximum: avgTime10
	});
	dijit.byId('cargandoDatosDialog').hide();
}
